import dark from './dark.ts';
import light from './light.ts';

import type { CustomTokenParams } from 'antd-style';
import type { ThemeAppearance } from 'antd-style/lib/types/appearance';

const componentsWithoutTheme =  {
    Button: {
        colorPrimary: 'linear-gradient(248.85deg, #2C9108 -1.77%, #AFD83C 104.39%)',
        colorPrimaryHover: 'linear-gradient(248.85deg, #2C9108 -1.77%, #AFD83C 104.39%)',
        colorBgContainerDisabled: 'linear-gradient(248.85deg, #040c018a -1.77%, #27310d82 104.39%)',

        defaultBg: 'linear-gradient(248.85deg, #DB0505 -1.77%, #E66565 104.39%)',
        defaultHoverBg: 'linear-gradient(248.85deg, #DB0505 -1.77%, #E66565 104.39%)',
        defaultColor: '#FFF',

        colorTextDisabled: '#434D56',
        fontWeight: 600,
        paddingInline: 24,
        paddingBlock: 12,
    },
    Badge: {
        dotSize: 8,
    },
};

const colors = {
    light: {
        ...light,
        components: {
            ...light.components,
            ...componentsWithoutTheme,
        },
    },
    dark: {
        ...dark,
        components: {
            ...dark.components,
            ...componentsWithoutTheme,
        },
    },
};

export function getThemeColors (themeName: ThemeAppearance) {
    return colors[themeName as 'dark' | 'light'];
}

export function getCustomTokens (customTokenParams: CustomTokenParams) {
    return customTokenParams.appearance === 'dark'
        ? dark.customToken
        : light.customToken;
}
